package com.bjsxt.commu3;

public class ConsumeRunnable implements Runnable{

    private Product product;

    public ConsumeRunnable(Product product) {
        this.product = product;
    }
    @Override
    public void run() {
        while (true) {
            //生产者和消费者都要加锁，且要是同一把锁
            product.consume();
        }

    }
}
